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

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

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

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

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

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

h = A("h")
e = B("e")
b = C("b")
l = D("l")
f = E("f")
n = F("n")
m = F("m")
d = A("d")
g = F("g")
i = E("i")

h.v = e
e.s = d
e.x = l
e.w = f
b.u = f
l.u = f
l.r = h
f.x = l
n.r = e
n.q = m
n.u = h
n.t = b
m.r = e
m.q = g
m.u = h
m.t = b
d.v = e
g.r = e
g.q = n
g.u = d
g.t = b
i.x = l
assert b.u.x.r.v.s.v.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

h = A("h")
e = B("e")
b = C("b")
l = D("l")
f = E("f")
n = F("n")
m = F("m")
d = A("d")
g = F("g")
i = E("i")

h.v = e
e.s = d
e.x = l
e.w = f
b.u = f
l.u = f
l.r = h
f.x = l
n.r = e
n.q = m
n.u = h
n.t = b
m.r = e
m.q = g
m.u = h
m.t = b
d.v = e
g.r = e
g.q = n
g.u = d
g.t = b
i.x = l
assert b.u.x.r.v.s.v.w.x.txt == "l"