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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: C = None
        self.x: E = None
        self.y: B = None
        self.t: F = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.q: C = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

c = A("c")
f = B("f")
k = C("k")
m = D("m")
h = E("h")
d = F("d")
n = E("n")

c.o = k
f.o = k
f.q = m
f.w = h
f.y = d
f.r = c
k.r = c
k.v = n
k.w = d
m.s = h
m.w = k
m.u = k
m.x = n
m.y = f
m.t = d
h.x = k
h.v = n
d.r = f
d.y = f
d.v = f
d.q = k
d.u = k
n.x = k
n.v = h
assert h.x.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: C = None
        self.x: E = None
        self.y: B = None
        self.t: F = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.q: C = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

c = A("c")
f = B("f")
k = C("k")
m = D("m")
h = E("h")
d = F("d")
n = E("n")

c.o = k
f.o = k
f.q = m
f.w = h
f.y = d
f.r = c
k.r = c
k.v = n
k.w = d
m.s = h
m.w = k
m.u = k
m.x = n
m.y = f
m.t = d
h.x = k
h.v = n
d.r = f
d.y = f
d.v = f
d.q = k
d.u = k
n.x = k
n.v = h
assert h.x.r.o.txt == "k"