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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

e.x = n
e.q = n
e.o = k
k.o = g
k.w = n
k.x = e
c.x = k
c.s = k
c.t = n
c.w = l
c.o = g
c.u = d
l.x = e
n.w = c
n.r = f
g.t = d
g.y = d
d.r = k
d.u = c
f.t = d
f.y = d
assert g.t.r.o.t.u.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

e.x = n
e.q = n
e.o = k
k.o = g
k.w = n
k.x = e
c.x = k
c.s = k
c.t = n
c.w = l
c.o = g
c.u = d
l.x = e
n.w = c
n.r = f
g.t = d
g.y = d
d.r = k
d.u = c
f.t = d
f.y = d
assert g.t.r.o.t.u.o.y.txt == "d"