class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: D = None
        self.r: E = None
        self.s: D = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: A = None
        self.y: G = None
        self.q: F = None
        self.z: F = None
        self.s: C = None
        self.v: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: A = None
        self.y: G = None
        self.q: F = None
        self.z: F = None
        self.s: C = None
        self.v: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

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

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