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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: C = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.p: F = None
        self.o: D = None
        self.q: B = None
        self.w: H = None
        self.txt = txt

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

k = A("k")
n = B("n")
b = C("b")
f = D("f")
g = E("g")
l = F("l")
m = G("m")
a = H("a")
e = F("e")
h = A("h")

k.p = g
k.z = b
k.o = b
k.w = m
k.v = h
k.y = h
k.q = l
n.o = l
n.y = a
n.t = f
n.x = m
b.o = m
f.q = e
g.q = b
l.x = e
l.z = b
l.y = n
m.t = g
m.r = n
m.q = n
m.p = l
m.o = f
m.w = a
a.r = n
e.x = l
e.z = b
e.y = n
h.p = g
h.z = b
h.o = b
h.w = m
h.v = k
h.y = k
h.q = e
assert a.r.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.w: G = None
        self.v: A = None
        self.o: C = None
        self.q: F = None
        self.y: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: C = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.p: F = None
        self.o: D = None
        self.q: B = None
        self.w: H = None
        self.txt = txt

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

k = A("k")
n = B("n")
b = C("b")
f = D("f")
g = E("g")
l = F("l")
m = G("m")
a = H("a")
e = F("e")
h = A("h")

k.p = g
k.z = b
k.o = b
k.w = m
k.v = h
k.y = h
k.q = l
n.o = l
n.y = a
n.t = f
n.x = m
b.o = m
f.q = e
g.q = b
l.x = e
l.z = b
l.y = n
m.t = g
m.r = n
m.q = n
m.p = l
m.o = f
m.w = a
a.r = n
e.x = l
e.z = b
e.y = n
h.p = g
h.z = b
h.o = b
h.w = m
h.v = k
h.y = k
h.q = e
assert a.r.t.q.txt == "e"