class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: A = None
        self.u: B = None
        self.y: B = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: A = None
        self.u: B = None
        self.y: B = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

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

c.y = l
c.o = l
c.q = a
a.w = i
a.u = e
a.o = m
i.s = m
i.p = e
i.y = e
m.x = e
d.p = e
d.u = a
d.t = l
e.y = d
l.o = a
l.u = a
l.y = a
l.p = a
l.w = c
l.z = m
assert c.q.o.x.y.p.y.t.txt == "l"