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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.o: C = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

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

a = A("a")
h = B("h")
g = C("g")
e = D("e")
j = E("j")
n = F("n")
b = A("b")

a.w = n
h.t = n
h.r = j
h.z = e
g.v = n
g.u = b
g.q = h
e.v = h
e.w = h
e.o = g
e.u = g
e.t = j
j.y = g
j.z = h
j.o = n
j.q = n
j.s = e
n.p = h
n.w = h
n.o = j
n.t = j
n.v = e
b.w = n
assert e.t.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.o: C = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

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

a = A("a")
h = B("h")
g = C("g")
e = D("e")
j = E("j")
n = F("n")
b = A("b")

a.w = n
h.t = n
h.r = j
h.z = e
g.v = n
g.u = b
g.q = h
e.v = h
e.w = h
e.o = g
e.u = g
e.t = j
j.y = g
j.z = h
j.o = n
j.q = n
j.s = e
n.p = h
n.w = h
n.o = j
n.t = j
n.v = e
b.w = n
assert e.t.y.q.txt == "h"