class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.v: F = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: F = None
        self.p: D = None
        self.t: G = None
        self.s: E = None
        self.x: G = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.q: A = None
        self.z: E = None
        self.r: H = None
        self.x: E = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.v: F = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: F = None
        self.p: D = None
        self.t: G = None
        self.s: E = None
        self.x: G = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.q: A = None
        self.z: E = None
        self.r: H = None
        self.x: E = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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