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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.u: A = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.o: H = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

b = A("b")
e = B("e")
l = C("l")
h = D("h")
c = E("c")
k = F("k")
j = G("j")
a = H("a")

b.x = c
b.p = e
b.z = e
e.z = j
e.q = j
l.v = b
l.w = k
l.y = k
l.o = a
h.r = a
c.v = l
c.s = b
c.q = h
c.u = a
k.p = l
k.w = b
k.u = b
k.z = h
j.w = b
j.r = b
j.o = a
j.s = c
a.v = b
assert h.r.v.x.v.w.z.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.u: A = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.o: H = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

b = A("b")
e = B("e")
l = C("l")
h = D("h")
c = E("c")
k = F("k")
j = G("j")
a = H("a")

b.x = c
b.p = e
b.z = e
e.z = j
e.q = j
l.v = b
l.w = k
l.y = k
l.o = a
h.r = a
c.v = l
c.s = b
c.q = h
c.u = a
k.p = l
k.w = b
k.u = b
k.z = h
j.w = b
j.r = b
j.o = a
j.s = c
a.v = b
assert h.r.v.x.v.w.z.r.v.txt == "b"