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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.x: B = None
        self.z: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: C = None
        self.r: D = None
        self.v: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.x: B = None
        self.z: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: C = None
        self.r: D = None
        self.v: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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