class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: G = None
        self.z: F = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: B = None
        self.o: G = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

g = A("g")
c = B("c")
k = C("k")
i = D("i")
n = E("n")
d = F("d")
b = G("b")
l = B("l")

g.x = b
g.y = b
g.z = d
g.p = d
g.v = n
c.x = i
k.y = n
i.y = d
i.s = d
i.v = c
i.o = b
n.z = d
d.p = l
d.y = b
d.s = k
b.p = d
l.x = i
assert l.x.o.p.p.x.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: G = None
        self.z: F = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: B = None
        self.o: G = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

g = A("g")
c = B("c")
k = C("k")
i = D("i")
n = E("n")
d = F("d")
b = G("b")
l = B("l")

g.x = b
g.y = b
g.z = d
g.p = d
g.v = n
c.x = i
k.y = n
i.y = d
i.s = d
i.v = c
i.o = b
n.z = d
d.p = l
d.y = b
d.s = k
b.p = d
l.x = i
assert l.x.o.p.p.x.y.y.txt == "b"