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

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

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

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

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

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

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

n.w = f
f.w = l
b.q = n
b.y = n
b.s = l
b.v = h
b.u = c
b.w = i
c.p = f
m.w = n
m.r = n
m.z = c
m.v = c
m.y = b
l.p = f
l.o = f
l.v = c
l.r = n
l.z = i
l.w = h
i.w = n
i.r = n
i.z = c
i.v = c
i.y = b
h.p = f
h.o = f
h.v = c
h.r = n
h.z = i
h.w = l
assert f.w.z.y.s.o.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

n.w = f
f.w = l
b.q = n
b.y = n
b.s = l
b.v = h
b.u = c
b.w = i
c.p = f
m.w = n
m.r = n
m.z = c
m.v = c
m.y = b
l.p = f
l.o = f
l.v = c
l.r = n
l.z = i
l.w = h
i.w = n
i.r = n
i.z = c
i.v = c
i.y = b
h.p = f
h.o = f
h.v = c
h.r = n
h.z = i
h.w = l
assert f.w.z.y.s.o.w.o.txt == "f"