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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.r: A = None
        self.q: F = None
        self.t: G = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

k = A("k")
i = B("i")
f = C("f")
g = D("g")
j = E("j")
h = F("h")
a = G("a")
d = A("d")

k.u = h
k.w = g
i.v = h
i.z = h
i.x = h
i.o = j
f.w = d
g.w = f
g.o = j
j.v = h
j.q = h
j.z = k
j.r = k
j.t = a
j.w = i
h.y = d
a.z = j
d.u = h
d.w = g
assert h.y.u.y.w.o.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.r: A = None
        self.q: F = None
        self.t: G = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

k = A("k")
i = B("i")
f = C("f")
g = D("g")
j = E("j")
h = F("h")
a = G("a")
d = A("d")

k.u = h
k.w = g
i.v = h
i.z = h
i.x = h
i.o = j
f.w = d
g.w = f
g.o = j
j.v = h
j.q = h
j.z = k
j.r = k
j.t = a
j.w = i
h.y = d
a.z = j
d.u = h
d.w = g
assert h.y.u.y.w.o.v.y.txt == "d"