class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: G = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.q: G = None
        self.o: H = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: H = None
        self.y: F = None
        self.t: F = None
        self.v: H = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: C = None
        self.y: A = None
        self.w: G = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: F = None
        self.q: F = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: E = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.q: G = None
        self.o: H = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: H = None
        self.y: F = None
        self.t: F = None
        self.v: H = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: C = None
        self.y: A = None
        self.w: G = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: F = None
        self.q: F = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: E = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

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

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