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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.z: H = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.z: H = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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