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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: D = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: D = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: B = None
        self.w: B = None
        self.txt = txt

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

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