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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.t: A = None
        self.z: B = None
        self.w: A = None
        self.s: D = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
h = C("h")
n = D("n")
c = E("c")
b = F("b")
j = D("j")

i.p = c
i.v = h
d.u = i
d.x = h
h.y = c
h.p = n
n.q = h
n.x = c
n.t = i
n.w = i
n.z = d
n.s = j
c.t = d
c.w = b
b.u = c
b.v = d
j.q = h
j.x = c
j.t = i
j.w = i
j.z = d
j.s = n
assert i.v.p.s.t.v.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.t: A = None
        self.z: B = None
        self.w: A = None
        self.s: D = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
h = C("h")
n = D("n")
c = E("c")
b = F("b")
j = D("j")

i.p = c
i.v = h
d.u = i
d.x = h
h.y = c
h.p = n
n.q = h
n.x = c
n.t = i
n.w = i
n.z = d
n.s = j
c.t = d
c.w = b
b.u = c
b.v = d
j.q = h
j.x = c
j.t = i
j.w = i
j.z = d
j.s = n
assert i.v.p.s.t.v.p.s.txt == "j"