class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: C = None
        self.q: B = None
        self.t: B = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: B = None
        self.txt = txt

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

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

f.v = h
f.s = l
f.q = m
f.t = m
f.p = m
f.x = c
m.q = l
m.r = l
m.w = l
m.o = c
m.s = e
l.p = h
e.x = l
e.w = m
e.z = h
c.y = h
c.r = m
h.w = c
h.x = c
h.q = l
k.q = l
k.r = l
k.w = l
k.o = c
k.s = e
i.v = h
i.s = l
i.q = m
i.t = m
i.p = k
i.x = c
assert c.r.s.z.q.p.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: C = None
        self.q: B = None
        self.t: B = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: B = None
        self.txt = txt

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

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

f.v = h
f.s = l
f.q = m
f.t = m
f.p = m
f.x = c
m.q = l
m.r = l
m.w = l
m.o = c
m.s = e
l.p = h
e.x = l
e.w = m
e.z = h
c.y = h
c.r = m
h.w = c
h.x = c
h.q = l
k.q = l
k.r = l
k.w = l
k.o = c
k.s = e
i.v = h
i.s = l
i.q = m
i.t = m
i.p = k
i.x = c
assert c.r.s.z.q.p.w.r.txt == "m"