class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: B = None
        self.v: C = None
        self.y: D = None
        self.x: E = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.r: G = None
        self.t: E = None
        self.v: C = None
        self.o: C = None
        self.s: E = None
        self.txt = txt

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

c = A("c")
e = B("e")
d = C("d")
m = D("m")
f = E("f")
n = F("n")
i = G("i")

c.w = f
c.x = f
c.q = e
c.v = d
c.y = m
c.z = m
e.r = c
e.y = c
e.q = c
d.w = n
m.p = f
m.v = f
m.o = f
m.t = n
m.y = e
m.x = e
m.z = e
f.x = m
f.z = c
n.z = e
n.x = c
n.r = i
n.t = f
n.s = f
n.v = d
n.o = d
i.t = n
assert d.w.z.r.z.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: B = None
        self.v: C = None
        self.y: D = None
        self.x: E = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.r: G = None
        self.t: E = None
        self.v: C = None
        self.o: C = None
        self.s: E = None
        self.txt = txt

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

c = A("c")
e = B("e")
d = C("d")
m = D("m")
f = E("f")
n = F("n")
i = G("i")

c.w = f
c.x = f
c.q = e
c.v = d
c.y = m
c.z = m
e.r = c
e.y = c
e.q = c
d.w = n
m.p = f
m.v = f
m.o = f
m.t = n
m.y = e
m.x = e
m.z = e
f.x = m
f.z = c
n.z = e
n.x = c
n.r = i
n.t = f
n.s = f
n.v = d
n.o = d
i.t = n
assert d.w.z.r.z.t.x.txt == "c"