class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.r: C = None
        self.w: E = None
        self.p: C = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: E = None
        self.r: C = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: A = None
        self.w: C = None
        self.z: E = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: E = None
        self.r: C = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: A = None
        self.w: C = None
        self.z: E = None
        self.y: D = None
        self.txt = txt

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

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