class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: G = None
        self.o: F = None
        self.t: E = None
        self.p: C = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: F = None
        self.q: B = None
        self.p: G = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: F = None
        self.q: B = None
        self.p: G = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

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