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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: A = None
        self.v: G = None
        self.u: D = None
        self.q: G = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: A = None
        self.v: G = None
        self.u: D = None
        self.q: G = None
        self.t: D = None
        self.txt = txt

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

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

e.u = m
m.u = f
m.y = c
a.v = m
a.p = g
i.v = e
i.s = a
i.u = l
l.x = j
l.s = m
f.s = j
f.r = e
f.v = c
f.q = c
f.u = i
f.t = i
c.x = l
c.p = l
j.u = m
g.v = m
g.p = a
assert i.v.u.u.r.u.u.r.u.u.txt == "f"