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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: H = None
        self.v: G = None
        self.z: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: H = None
        self.v: G = None
        self.z: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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