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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.q: G = None
        self.p: G = None
        self.r: A = None
        self.z: E = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: A = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: B = None
        self.p: B = None
        self.t: H = None
        self.s: B = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.q: G = None
        self.p: G = None
        self.r: A = None
        self.z: E = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: A = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: B = None
        self.p: B = None
        self.t: H = None
        self.s: B = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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