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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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