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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: D = None
        self.x: D = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: D = None
        self.x: D = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

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

j.t = i
j.x = f
j.v = f
j.s = k
g.x = n
g.s = c
g.v = j
l.q = c
n.q = j
i.y = j
f.o = n
f.w = n
f.x = n
f.s = n
f.y = l
h.o = n
h.w = n
h.x = n
h.s = n
h.y = l
a.y = j
c.x = n
c.s = g
c.v = j
k.t = i
k.x = h
k.v = h
k.s = j
assert c.v.t.y.v.txt == "f"