class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: G = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: H = None
        self.z: E = None
        self.x: A = None
        self.w: E = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.w: E = None
        self.s: F = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: H = None
        self.z: E = None
        self.x: A = None
        self.w: E = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.w: E = None
        self.s: F = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: F = None
        self.txt = txt

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

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

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