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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.z: H = None
        self.s: E = None
        self.r: I = None
        self.o: I = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: I = None
        self.v: E = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.p: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: I = None
        self.u: F = None
        self.p: A = None
        self.s: G = None
        self.r: G = None
        self.t: F = None
        self.q: C = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: H = None
        self.s: D = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.z: H = None
        self.s: E = None
        self.r: I = None
        self.o: I = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: I = None
        self.v: E = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.p: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: I = None
        self.u: F = None
        self.p: A = None
        self.s: G = None
        self.r: G = None
        self.t: F = None
        self.q: C = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: H = None
        self.s: D = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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