class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: C = None
        self.w: B = None
        self.u: H = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.q: D = None
        self.r: A = None
        self.t: G = None
        self.u: D = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.x: A = None
        self.t: B = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: D = None
        self.v: B = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.q: D = None
        self.r: A = None
        self.t: G = None
        self.u: D = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.x: A = None
        self.t: B = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: D = None
        self.v: B = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

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

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