class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.v: C = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: C = None
        self.v: B = None
        self.y: F = None
        self.u: A = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: D = None
        self.p: A = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: D = None
        self.txt = txt

j = A("j")
b = B("b")
f = C("f")
a = D("a")
h = E("h")
e = F("e")
g = B("g")
m = D("m")
i = F("i")
k = C("k")

j.u = f
j.x = b
j.v = k
j.r = m
j.w = m
b.x = f
b.s = f
b.v = g
b.y = e
b.u = j
b.q = i
f.u = j
f.v = i
a.v = i
a.o = g
a.u = h
a.w = f
h.t = j
h.p = j
h.z = m
h.y = e
e.w = b
e.y = m
g.x = k
g.s = k
g.v = b
g.y = e
g.q = e
g.u = j
m.v = e
m.o = b
m.u = h
m.w = f
i.w = g
i.y = a
k.u = j
k.v = i
assert h.p.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.v: C = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: C = None
        self.v: B = None
        self.y: F = None
        self.u: A = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: D = None
        self.p: A = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: D = None
        self.txt = txt

j = A("j")
b = B("b")
f = C("f")
a = D("a")
h = E("h")
e = F("e")
g = B("g")
m = D("m")
i = F("i")
k = C("k")

j.u = f
j.x = b
j.v = k
j.r = m
j.w = m
b.x = f
b.s = f
b.v = g
b.y = e
b.u = j
b.q = i
f.u = j
f.v = i
a.v = i
a.o = g
a.u = h
a.w = f
h.t = j
h.p = j
h.z = m
h.y = e
e.w = b
e.y = m
g.x = k
g.s = k
g.v = b
g.y = e
g.q = e
g.u = j
m.v = e
m.o = b
m.u = h
m.w = f
i.w = g
i.y = a
k.u = j
k.v = i
assert h.p.x.u.txt == "j"