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

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

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

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

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

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

a = A("a")
i = B("i")
c = C("c")
j = D("j")
l = E("l")
g = F("g")
e = A("e")
d = F("d")

a.p = i
a.q = c
i.p = c
i.q = c
i.s = c
i.v = g
c.s = i
j.w = l
j.y = d
l.t = d
l.y = j
g.q = d
g.w = l
g.y = l
e.p = i
e.q = c
d.q = g
d.w = l
d.y = l
assert e.p.q.s.v.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

a = A("a")
i = B("i")
c = C("c")
j = D("j")
l = E("l")
g = F("g")
e = A("e")
d = F("d")

a.p = i
a.q = c
i.p = c
i.q = c
i.s = c
i.v = g
c.s = i
j.w = l
j.y = d
l.t = d
l.y = j
g.q = d
g.w = l
g.y = l
e.p = i
e.q = c
d.q = g
d.w = l
d.y = l
assert e.p.q.s.v.q.q.q.txt == "d"