class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: H = None
        self.p: F = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: A = None
        self.z: A = None
        self.p: H = None
        self.u: D = 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.s: E = None
        self.z: H = None
        self.x: E = None
        self.w: B = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
h = C("h")
k = D("k")
f = E("f")
g = F("g")
l = G("l")
j = H("j")
c = I("c")
a = I("a")

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

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: A = None
        self.z: A = None
        self.p: H = None
        self.u: D = 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.s: E = None
        self.z: H = None
        self.x: E = None
        self.w: B = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
h = C("h")
k = D("k")
f = E("f")
g = F("g")
l = G("l")
j = H("j")
c = I("c")
a = I("a")

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