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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: J = None
        self.q: J = None
        self.s: I = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: H = None
        self.q: D = None
        self.r: A = None
        self.v: C = None
        self.w: D = None
        self.y: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: B = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: J = None
        self.p: F = None
        self.v: I = None
        self.z: J = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: J = None
        self.q: J = None
        self.s: I = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: H = None
        self.q: D = None
        self.r: A = None
        self.v: C = None
        self.w: D = None
        self.y: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: B = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: J = None
        self.p: F = None
        self.v: I = None
        self.z: J = None
        self.txt = txt

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

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

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

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