class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: F = None
        self.r: I = None
        self.z: C = None
        self.p: H = None
        self.v: D = None
        self.x: G = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: G = None
        self.p: G = None
        self.u: B = None
        self.q: I = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: I = None
        self.r: B = None
        self.o: G = None
        self.q: F = None
        self.z: F = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: E = None
        self.r: B = None
        self.u: A = None
        self.txt = txt

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

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

b = A("b")
h = B("h")
d = C("d")
g = D("g")
c = E("c")
l = F("l")
m = G("m")
i = H("i")
k = I("k")
f = E("f")

b.s = d
b.z = d
b.t = l
b.r = k
b.p = i
b.q = i
b.v = g
b.x = m
h.r = b
h.y = b
h.t = m
h.p = m
h.x = m
h.u = g
h.z = l
d.x = k
d.q = k
d.y = m
d.p = m
d.u = h
d.t = c
g.x = d
c.v = d
c.y = k
c.r = h
c.o = m
c.q = l
c.z = l
c.x = l
l.u = g
l.z = g
l.p = m
l.r = b
l.x = b
l.t = k
l.v = h
l.q = c
m.x = g
m.p = f
m.r = h
m.u = b
i.s = f
i.z = f
k.y = g
f.v = d
f.y = k
f.r = h
f.o = m
f.q = l
f.z = l
f.x = l
assert b.z.x.y.x.u.r.s.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: F = None
        self.r: I = None
        self.z: C = None
        self.p: H = None
        self.v: D = None
        self.x: G = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: G = None
        self.p: G = None
        self.u: B = None
        self.q: I = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: I = None
        self.r: B = None
        self.o: G = None
        self.q: F = None
        self.z: F = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: E = None
        self.r: B = None
        self.u: A = None
        self.txt = txt

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

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

b = A("b")
h = B("h")
d = C("d")
g = D("g")
c = E("c")
l = F("l")
m = G("m")
i = H("i")
k = I("k")
f = E("f")

b.s = d
b.z = d
b.t = l
b.r = k
b.p = i
b.q = i
b.v = g
b.x = m
h.r = b
h.y = b
h.t = m
h.p = m
h.x = m
h.u = g
h.z = l
d.x = k
d.q = k
d.y = m
d.p = m
d.u = h
d.t = c
g.x = d
c.v = d
c.y = k
c.r = h
c.o = m
c.q = l
c.z = l
c.x = l
l.u = g
l.z = g
l.p = m
l.r = b
l.x = b
l.t = k
l.v = h
l.q = c
m.x = g
m.p = f
m.r = h
m.u = b
i.s = f
i.z = f
k.y = g
f.v = d
f.y = k
f.r = h
f.o = m
f.q = l
f.z = l
f.x = l
assert b.z.x.y.x.u.r.s.y.p.txt == "f"