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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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