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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: F = None
        self.t: F = None
        self.y: C = None
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: F = None
        self.t: F = None
        self.y: C = None
        self.s: B = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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