class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: D = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: G = None
        self.o: F = None
        self.r: B = None
        self.t: B = None
        self.q: F = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: E = None
        self.o: C = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: G = None
        self.o: F = None
        self.r: B = None
        self.t: B = None
        self.q: F = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: E = None
        self.o: C = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

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

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