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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.p: E = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

g = A("g")
i = B("i")
j = C("j")
c = D("c")
h = E("h")
e = C("e")
f = A("f")

g.s = j
g.t = j
i.x = j
i.t = j
i.w = e
i.p = h
j.t = i
j.w = i
j.v = i
c.s = i
c.p = i
h.r = e
e.t = i
e.w = i
e.v = i
f.s = j
f.t = e
assert e.t.p.r.w.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.p: E = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

g = A("g")
i = B("i")
j = C("j")
c = D("c")
h = E("h")
e = C("e")
f = A("f")

g.s = j
g.t = j
i.x = j
i.t = j
i.w = e
i.p = h
j.t = i
j.w = i
j.v = i
c.s = i
c.p = i
h.r = e
e.t = i
e.w = i
e.v = i
f.s = j
f.t = e
assert e.t.p.r.w.w.v.txt == "i"