class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.x: G = None
        self.w: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: E = None
        self.w: A = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.x: A = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: J = None
        self.p: B = None
        self.z: H = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: A = None
        self.x: B = None
        self.s: F = None
        self.o: C = None
        self.z: C = None
        self.u: F = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.s: C = None
        self.x: H = None
        self.q: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.x: G = None
        self.w: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: E = None
        self.w: A = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.x: A = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: J = None
        self.p: B = None
        self.z: H = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: A = None
        self.x: B = None
        self.s: F = None
        self.o: C = None
        self.z: C = None
        self.u: F = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.s: C = None
        self.x: H = None
        self.q: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

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