class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: D = None
        self.v: A = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: C = None
        self.t: C = None
        self.s: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: C = None
        self.t: C = None
        self.s: C = None
        self.p: E = None
        self.txt = txt

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

b.q = m
b.x = n
b.v = a
b.w = a
b.p = h
i.o = f
i.v = f
i.q = h
f.w = i
f.o = i
f.z = h
f.v = b
f.y = n
d.w = a
h.q = f
h.r = m
h.s = d
m.w = h
m.p = h
m.o = f
m.t = f
m.s = f
a.q = m
a.x = n
a.v = b
a.w = b
a.p = h
n.w = a
assert b.v.x.w.x.w.p.q.y.txt == "n"