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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: F = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: H = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.y: D = None
        self.v: H = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: B = None
        self.r: C = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

d.x = h
d.o = f
d.t = f
d.q = b
d.v = n
n.u = b
n.s = m
n.p = h
j.p = f
j.s = n
j.o = h
j.r = b
j.x = d
f.q = m
f.p = m
f.s = l
h.v = j
h.x = n
m.w = f
m.y = f
m.u = j
m.v = l
m.o = h
b.s = h
b.q = n
b.o = n
b.r = j
l.y = m
assert h.v.r.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.q: G = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: F = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: H = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.y: D = None
        self.v: H = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: B = None
        self.r: C = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

d.x = h
d.o = f
d.t = f
d.q = b
d.v = n
n.u = b
n.s = m
n.p = h
j.p = f
j.s = n
j.o = h
j.r = b
j.x = d
f.q = m
f.p = m
f.s = l
h.v = j
h.x = n
m.w = f
m.y = f
m.u = j
m.v = l
m.o = h
b.s = h
b.q = n
b.o = n
b.r = j
l.y = m
assert h.v.r.o.s.txt == "m"