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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

f.p = j
f.u = j
f.o = j
f.v = c
f.s = d
d.x = f
g.s = f
g.p = h
g.y = h
g.u = c
g.v = c
g.q = i
g.o = i
g.t = j
c.q = h
j.r = d
j.t = f
j.u = f
j.v = f
j.z = c
j.y = b
j.s = i
i.z = j
h.q = i
b.z = i
b.p = g
b.y = f
b.o = h
b.v = j
assert g.p.q.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.o: E = None
        self.v: D = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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