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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: C = None
        self.o: B = None
        self.p: G = None
        self.x: E = None
        self.txt = txt

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

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

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

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

l = A("l")
h = B("h")
b = C("b")
d = D("d")
k = E("k")
a = F("a")
i = G("i")
e = C("e")

l.r = h
h.w = b
h.q = l
b.u = d
b.r = e
b.o = h
b.p = i
b.x = k
d.o = h
d.w = a
d.z = i
d.v = i
d.q = b
d.s = b
k.u = d
a.s = e
a.w = e
a.p = k
a.y = l
a.u = h
a.x = b
i.u = d
e.u = d
e.r = b
e.o = h
e.p = i
e.x = k
assert d.w.p.u.q.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: C = None
        self.o: B = None
        self.p: G = None
        self.x: E = None
        self.txt = txt

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

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

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

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

l = A("l")
h = B("h")
b = C("b")
d = D("d")
k = E("k")
a = F("a")
i = G("i")
e = C("e")

l.r = h
h.w = b
h.q = l
b.u = d
b.r = e
b.o = h
b.p = i
b.x = k
d.o = h
d.w = a
d.z = i
d.v = i
d.q = b
d.s = b
k.u = d
a.s = e
a.w = e
a.p = k
a.y = l
a.u = h
a.x = b
i.u = d
e.u = d
e.r = b
e.o = h
e.p = i
e.x = k
assert d.w.p.u.q.p.u.txt == "d"