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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: F = None
        self.s: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: F = None
        self.z: C = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

g = A("g")
b = B("b")
j = C("j")
h = D("h")
f = E("f")
l = F("l")
k = G("k")
i = H("i")
a = B("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: F = None
        self.s: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: F = None
        self.z: C = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

g = A("g")
b = B("b")
j = C("j")
h = D("h")
f = E("f")
l = F("l")
k = G("k")
i = H("i")
a = B("a")

g.v = l
b.y = f
b.x = l
b.v = g
b.t = a
j.o = h
h.v = l
h.w = l
h.s = g
f.w = b
f.z = g
l.x = k
l.p = k
l.o = f
k.v = a
k.t = g
i.w = j
i.z = j
i.o = l
i.x = l
i.r = b
a.y = f
a.x = l
a.v = g
a.t = b
assert h.s.v.o.z.v.txt == "l"