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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: D = None
        self.t: F = None
        self.q: A = None
        self.x: D = None
        self.s: E = 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: C = None
        self.z: B = None
        self.q: F = None
        self.o: C = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
b = C("b")
g = D("g")
d = E("d")
l = F("l")
k = C("k")
c = C("c")
f = F("f")
h = D("h")

m.v = d
m.x = d
a.v = f
a.t = f
a.o = h
a.x = h
a.q = m
a.s = d
b.y = d
g.y = c
g.z = a
g.q = l
g.o = b
d.t = k
l.u = d
l.z = m
l.w = a
k.y = d
c.y = d
f.u = d
f.z = m
f.w = a
h.y = k
h.z = a
h.q = f
h.o = b
assert f.z.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: D = None
        self.t: F = None
        self.q: A = None
        self.x: D = None
        self.s: E = 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: C = None
        self.z: B = None
        self.q: F = None
        self.o: C = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
b = C("b")
g = D("g")
d = E("d")
l = F("l")
k = C("k")
c = C("c")
f = F("f")
h = D("h")

m.v = d
m.x = d
a.v = f
a.t = f
a.o = h
a.x = h
a.q = m
a.s = d
b.y = d
g.y = c
g.z = a
g.q = l
g.o = b
d.t = k
l.u = d
l.z = m
l.w = a
k.y = d
c.y = d
f.u = d
f.z = m
f.w = a
h.y = k
h.z = a
h.q = f
h.o = b
assert f.z.x.t.txt == "k"