class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.w: A = None
        self.r: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: A = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

l = A("l")
c = B("c")
m = C("m")
a = D("a")
n = E("n")
e = F("e")
f = A("f")
k = B("k")
h = F("h")
i = B("i")

l.x = e
c.t = a
c.r = a
c.v = n
c.w = f
m.u = l
a.p = n
n.v = k
n.x = k
n.t = f
n.p = a
e.z = h
f.x = h
k.t = a
k.r = a
k.v = n
k.w = l
h.z = e
i.t = a
i.r = a
i.v = n
i.w = f
assert i.v.p.p.v.v.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.w: A = None
        self.r: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: A = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

l = A("l")
c = B("c")
m = C("m")
a = D("a")
n = E("n")
e = F("e")
f = A("f")
k = B("k")
h = F("h")
i = B("i")

l.x = e
c.t = a
c.r = a
c.v = n
c.w = f
m.u = l
a.p = n
n.v = k
n.x = k
n.t = f
n.p = a
e.z = h
f.x = h
k.t = a
k.r = a
k.v = n
k.w = l
h.z = e
i.t = a
i.r = a
i.v = n
i.w = f
assert i.v.p.p.v.v.t.x.txt == "h"