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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.r: G = None
        self.y: E = None
        self.w: D = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.r: G = None
        self.y: E = None
        self.w: D = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

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