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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.z: F = None
        self.u: F = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: E = None
        self.v: A = None
        self.q: B = None
        self.u: C = None
        self.z: E = None
        self.txt = txt

m = A("m")
d = B("d")
j = C("j")
n = D("n")
l = E("l")
k = F("k")
e = A("e")
h = D("h")
f = B("f")

m.v = n
m.w = k
m.u = l
m.r = h
d.s = k
j.p = k
j.q = k
n.x = l
n.r = l
n.v = d
n.z = k
n.u = k
n.o = f
l.x = m
l.o = m
k.o = h
k.x = l
k.z = l
k.v = m
k.q = d
k.u = j
e.v = n
e.r = n
e.w = k
e.u = l
h.x = l
h.r = l
h.v = f
h.o = f
h.z = k
h.u = k
f.s = k
assert f.s.z.x.v.x.x.w.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.u: E = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.z: F = None
        self.u: F = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: E = None
        self.v: A = None
        self.q: B = None
        self.u: C = None
        self.z: E = None
        self.txt = txt

m = A("m")
d = B("d")
j = C("j")
n = D("n")
l = E("l")
k = F("k")
e = A("e")
h = D("h")
f = B("f")

m.v = n
m.w = k
m.u = l
m.r = h
d.s = k
j.p = k
j.q = k
n.x = l
n.r = l
n.v = d
n.z = k
n.u = k
n.o = f
l.x = m
l.o = m
k.o = h
k.x = l
k.z = l
k.v = m
k.q = d
k.u = j
e.v = n
e.r = n
e.w = k
e.u = l
h.x = l
h.r = l
h.v = f
h.o = f
h.z = k
h.u = k
f.s = k
assert f.s.z.x.v.x.x.w.o.o.txt == "f"