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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: D = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.v: H = None
        self.x: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

f = A("f")
d = B("d")
a = C("a")
l = D("l")
j = E("j")
b = F("b")
m = G("m")
n = H("n")

f.v = n
f.u = l
d.q = n
d.u = l
d.o = a
a.w = l
a.s = l
a.v = n
a.y = n
a.x = d
l.w = b
j.p = a
j.v = a
j.t = l
b.r = f
b.t = f
b.x = l
b.v = a
b.p = n
b.q = j
m.v = d
n.s = l
n.q = b
n.r = f
assert d.u.w.p.s.w.p.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: D = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.v: H = None
        self.x: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

f = A("f")
d = B("d")
a = C("a")
l = D("l")
j = E("j")
b = F("b")
m = G("m")
n = H("n")

f.v = n
f.u = l
d.q = n
d.u = l
d.o = a
a.w = l
a.s = l
a.v = n
a.y = n
a.x = d
l.w = b
j.p = a
j.v = a
j.t = l
b.r = f
b.t = f
b.x = l
b.v = a
b.p = n
b.q = j
m.v = d
n.s = l
n.q = b
n.r = f
assert d.u.w.p.s.w.p.r.u.txt == "l"