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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.z: A = None
        self.s: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: F = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: E = None
        self.s: G = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.z: A = None
        self.s: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: F = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: E = None
        self.s: G = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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