class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: F = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.z: G = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: B = None
        self.z: E = None
        self.y: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.o: B = None
        self.q: E = None
        self.x: D = None
        self.v: E = None
        self.txt = txt

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

d.p = i
d.x = m
d.q = n
f.x = i
f.s = d
f.t = d
f.z = j
a.u = b
a.o = f
a.y = f
a.z = i
n.x = a
i.z = n
i.u = n
i.o = b
i.v = d
i.y = d
m.q = n
m.y = d
b.y = n
b.x = n
b.z = j
b.o = f
b.q = i
b.v = i
j.y = n
j.x = n
j.z = b
j.o = f
j.q = i
j.v = i
assert f.z.o.x.o.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: F = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.z: G = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: B = None
        self.z: E = None
        self.y: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.o: B = None
        self.q: E = None
        self.x: D = None
        self.v: E = None
        self.txt = txt

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

d.p = i
d.x = m
d.q = n
f.x = i
f.s = d
f.t = d
f.z = j
a.u = b
a.o = f
a.y = f
a.z = i
n.x = a
i.z = n
i.u = n
i.o = b
i.v = d
i.y = d
m.q = n
m.y = d
b.y = n
b.x = n
b.z = j
b.o = f
b.q = i
b.v = i
j.y = n
j.x = n
j.z = b
j.o = f
j.q = i
j.v = i
assert f.z.o.x.o.y.x.txt == "a"