class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.v: F = None
        self.o: D = None
        self.t: C = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: E = None
        self.u: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

n.y = k
n.t = k
n.x = l
n.v = d
n.z = d
n.o = b
g.x = l
g.z = l
g.u = l
g.q = l
k.x = h
k.r = b
k.y = d
k.o = d
b.v = g
b.u = l
b.o = d
l.t = d
d.v = n
d.z = n
h.x = k
h.r = b
h.y = d
h.o = d
assert g.z.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.v: F = None
        self.o: D = None
        self.t: C = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: E = None
        self.u: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

n.y = k
n.t = k
n.x = l
n.v = d
n.z = d
n.o = b
g.x = l
g.z = l
g.u = l
g.q = l
k.x = h
k.r = b
k.y = d
k.o = d
b.v = g
b.u = l
b.o = d
l.t = d
d.v = n
d.z = n
h.x = k
h.r = b
h.y = d
h.o = d
assert g.z.t.v.txt == "n"