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

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

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

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

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

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

e = A("e")
b = B("b")
h = C("h")
g = D("g")
l = E("l")
k = F("k")
a = F("a")

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

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

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

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

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

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

e = A("e")
b = B("b")
h = C("h")
g = D("g")
l = E("l")
k = F("k")
a = F("a")

e.q = l
b.q = e
b.z = g
b.w = g
b.p = h
b.v = h
b.o = a
h.v = e
g.z = h
g.w = h
g.p = a
g.y = l
l.v = k
l.w = a
l.y = h
l.z = e
l.o = e
l.u = e
k.w = l
k.q = g
a.w = l
a.q = g
assert b.z.w.v.q.y.txt == "h"