class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.s: C = None
        self.p: G = None
        self.txt = txt

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

j = A("j")
h = B("h")
e = C("e")
a = D("a")
k = E("k")
f = F("f")
d = G("d")
i = E("i")

j.u = i
j.z = i
j.w = e
h.o = i
h.u = d
h.p = e
e.p = h
e.y = f
a.p = j
a.o = j
a.x = h
k.s = d
k.r = i
k.u = a
f.x = e
f.u = e
f.s = e
f.p = d
d.t = j
d.r = j
d.y = f
d.p = f
d.o = a
i.s = d
i.r = k
i.u = a
assert f.x.p.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.s: C = None
        self.p: G = None
        self.txt = txt

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

j = A("j")
h = B("h")
e = C("e")
a = D("a")
k = E("k")
f = F("f")
d = G("d")
i = E("i")

j.u = i
j.z = i
j.w = e
h.o = i
h.u = d
h.p = e
e.p = h
e.y = f
a.p = j
a.o = j
a.x = h
k.s = d
k.r = i
k.u = a
f.x = e
f.u = e
f.s = e
f.p = d
d.t = j
d.r = j
d.y = f
d.p = f
d.o = a
i.s = d
i.r = k
i.u = a
assert f.x.p.p.y.txt == "f"