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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: G = None
        self.p: A = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.t: G = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: D = None
        self.y: A = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: G = None
        self.r: B = None
        self.z: C = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: G = None
        self.p: A = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.t: G = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: D = None
        self.y: A = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: G = None
        self.r: B = None
        self.z: C = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

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