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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: G = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: F = None
        self.q: E = None
        self.u: I = None
        self.v: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: G = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: F = None
        self.q: E = None
        self.u: I = None
        self.v: E = None
        self.p: E = None
        self.txt = txt

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

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