class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.t: C = None
        self.y: F = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.txt = txt

k = A("k")
m = B("m")
l = C("l")
b = D("b")
i = E("i")
h = F("h")
g = C("g")

k.x = g
k.s = m
k.p = m
m.w = g
m.y = g
m.q = b
m.t = b
m.z = h
m.r = l
l.v = k
l.q = k
l.p = b
l.t = g
l.y = h
b.q = g
b.y = m
b.o = m
i.u = b
i.v = b
i.o = h
i.t = k
h.s = b
h.q = b
g.v = k
g.q = k
g.p = b
g.t = l
g.y = h
assert k.x.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.t: C = None
        self.y: F = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.txt = txt

k = A("k")
m = B("m")
l = C("l")
b = D("b")
i = E("i")
h = F("h")
g = C("g")

k.x = g
k.s = m
k.p = m
m.w = g
m.y = g
m.q = b
m.t = b
m.z = h
m.r = l
l.v = k
l.q = k
l.p = b
l.t = g
l.y = h
b.q = g
b.y = m
b.o = m
i.u = b
i.v = b
i.o = h
i.t = k
h.s = b
h.q = b
g.v = k
g.q = k
g.p = b
g.t = l
g.y = h
assert k.x.q.x.txt == "g"