class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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