class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: F = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: F = None
        self.p: F = None
        self.v: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

m.y = k
m.x = c
m.q = d
k.p = e
k.y = b
k.v = m
k.t = f
b.w = c
b.s = c
b.p = c
b.v = c
b.r = e
e.t = c
f.r = e
f.t = c
f.u = c
f.p = g
f.x = g
f.s = g
c.t = d
c.y = f
c.u = e
c.q = g
c.s = g
c.p = b
d.s = k
d.y = b
g.v = b
assert b.r.t.t.y.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: F = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: F = None
        self.p: F = None
        self.v: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

m.y = k
m.x = c
m.q = d
k.p = e
k.y = b
k.v = m
k.t = f
b.w = c
b.s = c
b.p = c
b.v = c
b.r = e
e.t = c
f.r = e
f.t = c
f.u = c
f.p = g
f.x = g
f.s = g
c.t = d
c.y = f
c.u = e
c.q = g
c.s = g
c.p = b
d.s = k
d.y = b
g.v = b
assert b.r.t.t.y.r.t.txt == "c"