class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: G = None
        self.w: C = None
        self.p: E = None
        self.t: F = None
        self.q: G = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: B = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: A = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: D = None
        self.z: H = None
        self.x: E = None
        self.q: B = None
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.s: A = None
        self.p: A = None
        self.x: A = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: G = None
        self.w: C = None
        self.p: E = None
        self.t: F = None
        self.q: G = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: B = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: A = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: D = None
        self.z: H = None
        self.x: E = None
        self.q: B = None
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.s: A = None
        self.p: A = None
        self.x: A = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

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

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