class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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

f.x = g
f.o = m
l.t = b
c.r = a
c.v = m
c.y = f
m.v = f
i.w = f
i.q = f
i.t = m
i.r = g
n.w = g
n.x = m
n.s = m
n.z = k
n.q = c
a.t = c
k.w = f
k.q = f
k.t = m
k.r = i
b.r = l
b.v = m
b.y = f
g.w = f
g.q = f
g.t = m
g.r = k
assert g.t.v.o.v.txt == "f"