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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: J = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: I = None
        self.v: H = None
        self.z: D = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: I = None
        self.y: C = None
        self.w: B = None
        self.s: E = None
        self.u: J = None
        self.o: A = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: J = None
        self.o: H = None
        self.t: I = None
        self.x: F = None
        self.q: I = None
        self.p: E = None
        self.r: A = None
        self.w: E = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.y: A = None
        self.x: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: J = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: I = None
        self.v: H = None
        self.z: D = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: I = None
        self.y: C = None
        self.w: B = None
        self.s: E = None
        self.u: J = None
        self.o: A = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: J = None
        self.o: H = None
        self.t: I = None
        self.x: F = None
        self.q: I = None
        self.p: E = None
        self.r: A = None
        self.w: E = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.y: A = None
        self.x: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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