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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
b = B("b")
f = C("f")
e = D("e")
j = E("j")
m = F("m")
n = G("n")
k = G("k")

h.v = j
b.y = k
b.p = h
b.r = j
f.z = m
f.o = e
f.q = j
f.t = h
e.u = f
e.r = k
j.y = f
j.p = f
j.x = e
m.x = e
m.q = f
n.r = h
n.x = h
n.t = f
k.r = h
k.x = h
k.t = f
assert k.t.o.u.o.u.t.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
b = B("b")
f = C("f")
e = D("e")
j = E("j")
m = F("m")
n = G("n")
k = G("k")

h.v = j
b.y = k
b.p = h
b.r = j
f.z = m
f.o = e
f.q = j
f.t = h
e.u = f
e.r = k
j.y = f
j.p = f
j.x = e
m.x = e
m.q = f
n.r = h
n.x = h
n.t = f
k.r = h
k.x = h
k.t = f
assert k.t.o.u.o.u.t.v.x.txt == "e"