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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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