class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.v: H = None
        self.w: D = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: A = None
        self.z: C = None
        self.t: A = None
        self.p: G = None
        self.v: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: G = None
        self.r: E = None
        self.y: H = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.s: E = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: A = None
        self.w: B = None
        self.t: A = None
        self.z: B = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: A = None
        self.z: C = None
        self.t: A = None
        self.p: G = None
        self.v: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: G = None
        self.r: E = None
        self.y: H = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.s: E = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: A = None
        self.w: B = None
        self.t: A = None
        self.z: B = None
        self.q: E = None
        self.txt = txt

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

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