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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: A = None
        self.p: G = None
        self.w: E = None
        self.t: A = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.w: E = None
        self.o: B = None
        self.p: C = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.z: G = None
        self.u: C = None
        self.txt = txt

l = A("l")
m = B("m")
n = C("n")
i = D("i")
b = E("b")
k = F("k")
a = G("a")
d = G("d")
c = B("c")

l.r = k
m.z = i
m.o = l
m.t = l
m.q = l
m.p = a
m.w = b
n.t = l
n.p = m
i.u = b
i.w = b
i.s = n
i.p = n
i.o = c
i.v = c
i.q = c
b.u = n
b.z = n
k.w = l
k.o = i
a.q = l
a.p = k
a.z = d
a.u = n
d.q = l
d.p = k
d.z = a
d.u = n
c.z = i
c.o = l
c.t = l
c.q = l
c.p = a
c.w = b
assert k.o.u.u.t.r.w.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: A = None
        self.p: G = None
        self.w: E = None
        self.t: A = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.w: E = None
        self.o: B = None
        self.p: C = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.z: G = None
        self.u: C = None
        self.txt = txt

l = A("l")
m = B("m")
n = C("n")
i = D("i")
b = E("b")
k = F("k")
a = G("a")
d = G("d")
c = B("c")

l.r = k
m.z = i
m.o = l
m.t = l
m.q = l
m.p = a
m.w = b
n.t = l
n.p = m
i.u = b
i.w = b
i.s = n
i.p = n
i.o = c
i.v = c
i.q = c
b.u = n
b.z = n
k.w = l
k.o = i
a.q = l
a.p = k
a.z = d
a.u = n
d.q = l
d.p = k
d.z = a
d.u = n
c.z = i
c.o = l
c.t = l
c.q = l
c.p = a
c.w = b
assert k.o.u.u.t.r.w.r.w.txt == "l"