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

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

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

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

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

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

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

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

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

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

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

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

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

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

j.z = n
j.w = h
j.s = m
n.v = f
n.o = j
f.u = h
f.o = h
f.t = j
c.u = h
m.w = f
m.t = c
m.u = j
m.y = h
m.x = h
h.t = c
h.p = j
h.v = j
assert c.u.p.w.t.txt == "c"