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

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

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

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

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

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

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

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

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

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

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

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

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

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

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