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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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