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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: D = None
        self.u: H = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.o: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: H = None
        self.x: B = None
        self.p: H = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: C = None
        self.s: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: D = None
        self.u: H = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.o: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: H = None
        self.x: B = None
        self.p: H = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: C = None
        self.s: H = None
        self.txt = txt

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

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

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