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

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

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

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

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

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

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

a.v = b
d.v = h
d.w = f
d.y = a
j.u = b
j.y = a
f.y = h
h.s = f
h.q = f
h.w = a
b.u = h
b.r = i
m.y = h
n.u = b
n.y = a
i.v = h
i.w = m
i.y = a
g.u = b
g.y = a
assert b.u.w.v.r.v.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

a.v = b
d.v = h
d.w = f
d.y = a
j.u = b
j.y = a
f.y = h
h.s = f
h.q = f
h.w = a
b.u = h
b.r = i
m.y = h
n.u = b
n.y = a
i.v = h
i.w = m
i.y = a
g.u = b
g.y = a
assert b.u.w.v.r.v.s.y.txt == "h"