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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.txt = txt

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

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

m = A("m")
j = B("j")
k = C("k")
h = D("h")
a = E("a")
f = F("f")
n = C("n")
i = F("i")
b = C("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.txt = txt

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

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

m = A("m")
j = B("j")
k = C("k")
h = D("h")
a = E("a")
f = F("f")
n = C("n")
i = F("i")
b = C("b")

m.q = n
m.x = j
j.v = a
j.u = a
j.r = f
j.q = k
j.s = m
k.o = j
k.q = i
k.p = i
h.s = m
h.y = m
a.u = m
a.y = b
a.q = b
a.x = i
a.o = j
f.w = a
f.s = a
f.u = k
f.q = m
n.o = j
n.q = i
n.p = i
i.w = a
i.s = a
i.u = k
i.q = m
b.o = j
b.q = i
b.p = i
assert k.q.u.q.q.txt == "m"