class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: G = None
        self.s: D = None
        self.z: F = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: F = None
        self.t: F = None
        self.q: B = None
        self.s: B = None
        self.v: G = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: F = None
        self.q: G = None
        self.v: B = None
        self.w: G = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: F = None
        self.t: F = None
        self.q: B = None
        self.s: B = None
        self.v: G = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: F = None
        self.q: G = None
        self.v: B = None
        self.w: G = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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