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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

k = A("k")
b = B("b")
l = C("l")
i = D("i")
c = E("c")
f = F("f")
m = G("m")
j = F("j")

k.u = i
b.v = c
b.r = m
l.z = k
l.o = k
l.u = c
i.t = c
i.z = f
i.q = k
c.t = b
f.q = c
f.w = b
f.z = b
f.p = k
m.y = b
m.u = l
j.q = c
j.w = b
j.z = b
j.p = k
assert i.z.p.u.t.t.v.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

k = A("k")
b = B("b")
l = C("l")
i = D("i")
c = E("c")
f = F("f")
m = G("m")
j = F("j")

k.u = i
b.v = c
b.r = m
l.z = k
l.o = k
l.u = c
i.t = c
i.z = f
i.q = k
c.t = b
f.q = c
f.w = b
f.z = b
f.p = k
m.y = b
m.u = l
j.q = c
j.w = b
j.z = b
j.p = k
assert i.z.p.u.t.t.v.t.v.txt == "c"