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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.q: E = None
        self.w: B = None
        self.o: B = None
        self.r: A = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.q: E = None
        self.w: B = None
        self.o: B = None
        self.r: A = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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

b.t = m
b.u = d
b.w = k
l.r = g
g.t = f
g.x = f
g.v = f
g.q = d
g.w = l
g.o = l
g.r = b
m.p = f
d.t = g
d.p = m
d.u = k
k.p = b
k.r = l
k.z = l
k.w = l
k.v = m
k.q = h
k.t = d
k.o = f
h.u = k
f.q = l
f.o = m
assert f.o.p.q.r.o.r.r.t.txt == "m"