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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: E = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: B = None
        self.r: A = None
        self.x: B = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: D = None
        self.p: G = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

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

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

l.r = m
l.q = f
l.s = c
l.t = e
f.w = m
f.z = e
f.y = l
b.o = g
b.t = g
b.p = f
b.x = f
b.r = l
n.q = b
n.s = c
e.y = n
g.r = e
g.y = e
g.z = n
g.p = m
g.w = f
m.v = n
m.r = n
m.y = g
a.o = g
c.o = g
c.t = g
c.p = f
c.x = f
c.r = l
assert g.p.r.q.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: B = None
        self.s: C = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: E = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: B = None
        self.r: A = None
        self.x: B = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: D = None
        self.p: G = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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