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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: A = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: A = None
        self.x: B = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

f = A("f")
i = B("i")
c = C("c")
d = D("d")
j = E("j")
n = F("n")
g = B("g")
b = A("b")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: A = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: A = None
        self.x: B = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

f = A("f")
i = B("i")
c = C("c")
d = D("d")
j = E("j")
n = F("n")
g = B("g")
b = A("b")
a = F("a")

f.u = j
f.v = d
f.s = d
f.q = d
i.u = d
c.o = j
c.s = f
c.v = g
d.x = f
d.o = j
d.z = j
j.x = c
n.u = c
n.o = f
n.x = g
n.w = g
n.y = i
g.u = d
b.u = j
b.v = d
b.s = d
b.q = d
a.u = c
a.o = b
a.x = i
a.w = i
a.y = i
assert c.o.x.o.x.v.txt == "g"