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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: F = None
        self.u: G = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: C = None
        self.u: B = None
        self.x: C = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.u: B = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: F = None
        self.u: G = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: C = None
        self.u: B = None
        self.x: C = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.u: B = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

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

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

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