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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.txt = txt

i = A("i")
g = B("g")
d = C("d")
n = D("n")
j = E("j")
a = F("a")
b = G("b")
e = A("e")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.txt = txt

i = A("i")
g = B("g")
d = C("d")
n = D("n")
j = E("j")
a = F("a")
b = G("b")
e = A("e")

i.o = j
g.r = a
g.s = n
d.r = n
d.y = b
d.u = g
d.s = g
d.o = g
n.u = a
n.z = a
n.y = b
n.p = j
n.x = j
n.t = j
n.r = g
j.t = i
a.r = b
a.p = i
a.o = n
a.x = n
a.u = n
b.x = d
b.t = j
e.o = j
assert d.u.s.y.x.u.r.txt == "a"