class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.y: D = None
        self.p: B = None
        self.s: C = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.q: D = None
        self.s: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

l.r = f
l.y = f
l.w = d
l.t = d
l.p = k
l.s = a
k.r = l
k.o = l
k.q = f
k.s = d
a.u = g
a.v = n
a.q = j
f.p = a
f.t = l
f.z = l
f.u = l
f.y = l
f.o = l
f.w = g
j.p = g
j.w = a
j.z = f
j.y = d
g.v = a
d.p = a
n.r = l
n.o = l
n.q = f
n.s = d
assert a.v.s.p.v.o.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.y: D = None
        self.p: B = None
        self.s: C = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.q: D = None
        self.s: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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