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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.x: F = None
        self.s: F = None
        self.p: D = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.v: D = None
        self.s: B = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.r: A = None
        self.y: E = None
        self.u: A = None
        self.txt = txt

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

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

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

k.w = a
k.q = n
k.o = c
l.v = k
l.u = a
l.x = a
l.s = a
l.p = c
l.q = n
n.p = a
n.u = a
n.v = c
n.z = c
n.s = l
n.q = f
c.s = k
c.r = k
c.u = k
c.t = l
c.y = f
f.y = c
a.s = c
a.y = n
a.r = k
a.q = k
h.y = c
b.y = c
assert f.y.s.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.x: F = None
        self.s: F = None
        self.p: D = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.v: D = None
        self.s: B = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.r: A = None
        self.y: E = None
        self.u: A = None
        self.txt = txt

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

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

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

k.w = a
k.q = n
k.o = c
l.v = k
l.u = a
l.x = a
l.s = a
l.p = c
l.q = n
n.p = a
n.u = a
n.v = c
n.z = c
n.s = l
n.q = f
c.s = k
c.r = k
c.u = k
c.t = l
c.y = f
f.y = c
a.s = c
a.y = n
a.r = k
a.q = k
h.y = c
b.y = c
assert f.y.s.w.r.txt == "k"