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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.q: E = None
        self.v: F = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: A = None
        self.p: B = None
        self.v: D = None
        self.t: G = None
        self.y: C = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: F = None
        self.txt = txt

j = A("j")
a = B("a")
m = C("m")
f = D("f")
c = E("c")
g = F("g")
l = G("l")

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.q: E = None
        self.v: F = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: A = None
        self.p: B = None
        self.v: D = None
        self.t: G = None
        self.y: C = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: F = None
        self.txt = txt

j = A("j")
a = B("a")
m = C("m")
f = D("f")
c = E("c")
g = F("g")
l = G("l")

j.r = m
j.p = l
j.w = l
j.y = l
j.t = f
j.x = f
j.s = a
a.t = c
a.w = c
a.q = c
a.r = c
a.v = g
a.z = f
m.t = c
f.w = a
f.x = m
c.y = g
c.z = g
g.z = a
g.p = a
g.s = j
g.v = f
g.r = f
g.t = l
g.y = m
l.y = f
l.s = g
assert a.v.v.w.z.w.r.z.txt == "g"