class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: D = None
        self.q: B = None
        self.z: D = None
        self.w: G = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: D = None
        self.u: I = None
        self.r: A = None
        self.q: F = None
        self.v: H = None
        self.o: F = None
        self.s: G = None
        self.p: H = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: J = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: J = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.o: C = None
        self.w: D = None
        self.txt = txt

m = A("m")
l = B("l")
c = C("c")
j = D("j")
g = E("g")
k = F("k")
d = G("d")
f = H("f")
e = I("e")
h = J("h")

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: D = None
        self.u: I = None
        self.r: A = None
        self.q: F = None
        self.v: H = None
        self.o: F = None
        self.s: G = None
        self.p: H = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: J = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: J = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.o: C = None
        self.w: D = None
        self.txt = txt

m = A("m")
l = B("l")
c = C("c")
j = D("j")
g = E("g")
k = F("k")
d = G("d")
f = H("f")
e = I("e")
h = J("h")

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