class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.u: F = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.x: C = None
        self.p: A = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = 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.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: C = None
        self.t: G = None
        self.q: D = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.x: C = None
        self.p: A = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = 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.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: C = None
        self.t: G = None
        self.q: D = None
        self.z: G = None
        self.txt = txt

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

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