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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: D = None
        self.r: D = None
        self.v: G = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: D = None
        self.r: D = None
        self.v: G = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

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

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