class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.y: B = None
        self.v: A = None
        self.w: F = None
        self.txt = txt

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

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

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

i.y = n
i.u = g
i.t = m
m.u = i
m.t = l
m.r = j
m.w = e
l.s = j
l.y = j
l.x = e
g.x = l
g.t = c
e.s = d
e.w = d
e.z = l
e.y = m
e.v = i
j.u = e
c.t = g
n.s = j
n.y = j
n.x = e
d.u = e
assert g.t.t.x.x.w.u.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.y: B = None
        self.v: A = None
        self.w: F = None
        self.txt = txt

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

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

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

i.y = n
i.u = g
i.t = m
m.u = i
m.t = l
m.r = j
m.w = e
l.s = j
l.y = j
l.x = e
g.x = l
g.t = c
e.s = d
e.w = d
e.z = l
e.y = m
e.v = i
j.u = e
c.t = g
n.s = j
n.y = j
n.x = e
d.u = e
assert g.t.t.x.x.w.u.s.u.txt == "e"