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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: A = None
        self.r: A = None
        self.t: F = None
        self.y: F = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: E = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

l.u = i
f.p = i
f.v = l
f.r = l
f.t = j
f.y = n
f.u = d
d.q = l
d.v = l
d.t = e
d.o = g
g.p = l
g.y = d
g.v = f
e.q = l
e.y = n
e.u = n
e.r = f
e.v = d
n.u = i
n.x = i
n.o = d
n.t = g
i.o = e
i.t = g
j.u = i
j.x = i
j.o = d
j.t = g
assert l.u.t.v.p.o.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: A = None
        self.r: A = None
        self.t: F = None
        self.y: F = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: E = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

l.u = i
f.p = i
f.v = l
f.r = l
f.t = j
f.y = n
f.u = d
d.q = l
d.v = l
d.t = e
d.o = g
g.p = l
g.y = d
g.v = f
e.q = l
e.y = n
e.u = n
e.r = f
e.v = d
n.u = i
n.x = i
n.o = d
n.t = g
i.o = e
i.t = g
j.u = i
j.x = i
j.o = d
j.t = g
assert l.u.t.v.p.o.q.u.txt == "i"