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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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