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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.u: C = None
        self.r: F = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.s: D = None
        self.t: D = None
        self.z: G = None
        self.o: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.u: C = None
        self.r: F = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.s: D = None
        self.t: D = None
        self.z: G = None
        self.o: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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