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

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

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

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

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

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

d = A("d")
e = B("e")
g = C("g")
n = D("n")
m = E("m")
k = F("k")

d.v = m
d.y = m
e.z = k
e.t = m
g.o = n
g.x = k
n.x = k
n.y = k
m.o = k
k.z = n
k.x = n
k.v = m
assert k.v.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

d = A("d")
e = B("e")
g = C("g")
n = D("n")
m = E("m")
k = F("k")

d.v = m
d.y = m
e.z = k
e.t = m
g.o = n
g.x = k
n.x = k
n.y = k
m.o = k
k.z = n
k.x = n
k.v = m
assert k.v.o.z.txt == "n"