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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: A = None
        self.t: F = None
        self.x: B = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.z: E = None
        self.x: E = None
        self.r: E = None
        self.q: B = None
        self.txt = txt

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

j = A("j")
e = B("e")
d = C("d")
b = D("b")
k = E("k")
m = F("m")
l = E("l")
h = E("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: A = None
        self.t: F = None
        self.x: B = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.z: E = None
        self.x: E = None
        self.r: E = None
        self.q: B = None
        self.txt = txt

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

j = A("j")
e = B("e")
d = C("d")
b = D("b")
k = E("k")
m = F("m")
l = E("l")
h = E("h")

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