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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

i.p = l
i.w = m
i.s = a
c.w = i
l.r = a
l.u = c
e.s = i
e.q = m
g.z = c
m.p = e
m.v = c
m.o = c
m.y = i
m.r = k
k.z = c
h.r = a
h.u = c
a.p = e
a.v = c
a.o = c
a.y = i
a.r = g
assert a.v.w.s.p.q.p.txt == "e"