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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: D = None
        self.z: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: E = None
        self.u: G = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.w: E = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.s: A = None
        self.t: B = None
        self.o: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: D = None
        self.z: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: E = None
        self.u: G = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.w: E = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.s: A = None
        self.t: B = None
        self.o: A = None
        self.txt = txt

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

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