class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: B = None
        self.y: H = None
        self.r: B = None
        self.w: E = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: E = None
        self.v: E = None
        self.p: E = None
        self.q: G = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: B = None
        self.w: D = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.o: G = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.y: F = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: E = None
        self.v: E = None
        self.p: E = None
        self.q: G = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: B = None
        self.w: D = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.o: G = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.y: F = None
        self.r: B = None
        self.txt = txt

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

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