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

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

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

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

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

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

c = A("c")
m = B("m")
j = C("j")
i = D("i")
h = E("h")
n = F("n")

c.y = m
c.r = m
c.p = m
c.u = h
c.v = i
c.o = n
m.v = c
m.q = h
j.p = h
j.s = m
i.r = n
i.p = j
i.w = j
i.y = h
i.t = c
h.x = i
h.y = i
n.y = j
n.t = j
n.r = i
assert h.y.r.t.p.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: B = None
        self.u: E = None
        self.p: B = None
        self.v: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

c = A("c")
m = B("m")
j = C("j")
i = D("i")
h = E("h")
n = F("n")

c.y = m
c.r = m
c.p = m
c.u = h
c.v = i
c.o = n
m.v = c
m.q = h
j.p = h
j.s = m
i.r = n
i.p = j
i.w = j
i.y = h
i.t = c
h.x = i
h.y = i
n.y = j
n.t = j
n.r = i
assert h.y.r.t.p.y.w.txt == "j"