class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: G = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.q: F = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: G = None
        self.x: F = None
        self.t: A = None
        self.o: F = None
        self.s: E = None
        self.u: E = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.q: F = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: G = None
        self.x: F = None
        self.t: A = None
        self.o: F = None
        self.s: E = None
        self.u: E = None
        self.p: G = None
        self.txt = txt

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

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