class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: I = None
        self.x: B = None
        self.y: H = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: I = None
        self.r: H = None
        self.u: D = None
        self.t: H = None
        self.q: C = None
        self.o: H = None
        self.p: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: C = None
        self.x: D = None
        self.t: A = None
        self.v: D = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.z: C = None
        self.r: A = None
        self.y: G = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: I = None
        self.r: H = None
        self.u: D = None
        self.t: H = None
        self.q: C = None
        self.o: H = None
        self.p: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: C = None
        self.x: D = None
        self.t: A = None
        self.v: D = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.z: C = None
        self.r: A = None
        self.y: G = None
        self.p: D = None
        self.txt = txt

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

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